﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Emerson.Storage.Agent.Core
{
    [Serializable]
    public class WorkstationInfo
    {
        public string Name { get; set; }
        public string OSVersion { get; set; }
        public string IPAddress { get; set; }
    }

    [Serializable]
    public class BatteryInfo
    {
        public BatteryInfo()
        {
            BatteryType = "";
            Chemistry = "";
            PercentRemaining = 0.0;
            IsConnected = false;
            BatteryChargingState = Core.BatteryChargingState.Unknown;
            LastConnectedTime = new DateTime(2000, 1, 1);
        }

        public string BatteryType { get; set; }
        public string Chemistry { get; set; }
        public double PercentRemaining { get; set; }
        public bool IsConnected { get; set; }
        public DateTime LastConnectedTime { get; set; }
        public BatteryChargingState BatteryChargingState { get; set; }
        public double Temperature { get; set; }

        public override string ToString()
        {
            return "Battery Type: " + BatteryType + Environment.NewLine +
                "Is Connected: " + IsConnected + Environment.NewLine +
                "Last connected time: " + LastConnectedTime.ToString() + Environment.NewLine +
                "Chemistry: " + Chemistry + Environment.NewLine +
                "Percent Remaining: " + PercentRemaining.ToString() + Environment.NewLine +
                "Charging State: " + BatteryChargingState.ToString() + Environment.NewLine +
                "Temperature: " + Temperature.ToString() + Environment.NewLine;
        }
    }

    [Serializable]
    public enum BatteryChargingState
    {
        Discharging = 9470064,
        Charging = 14804223,
        Unknown = 16748574,
        Dual = 16748590,
    }

    public class WorkstationDataPack
    {
        public WorkstationDataPack()
        {
            stationInfo = new WorkstationInfo();
            batteryInfos = new List<BatteryInfo>();
        }
        public bool IsConnected;
        public WorkstationInfo stationInfo;
        public List<BatteryInfo> batteryInfos;
    }
}